package com.ssm.lzh.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.lzh.service.JcxService;
import com.ssm.mapper.JcxMapper;
import com.ssm.pojo.Jcx;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class JcxServiceImpl implements JcxService {

    @Resource
    private JcxMapper jcxMapper;

    @Override
    public PageInfo<Jcx> queryAllJcx(Page<Jcx> page) {
        PageHelper.startPage(page.getPageNum(),page.getPageSize());
        return new PageInfo<Jcx>(this.jcxMapper.queryAllJcx(page.getSearchObj()));
    }

    @Override
    public int addJcx(Jcx jcx) {
        return this.jcxMapper.addJcx(jcx);
    }

    @Override
    public int updateJcx(Jcx jcx) {
        return this.jcxMapper.updateJcx(jcx);
    }

    @Override
    public int deleteJcx(int id) {
        return this.jcxMapper.deleteJcx(id);
    }

    @Override
    public List<Jcx> queryAllJcx2() {
        return this.jcxMapper.queryAllJcx2();
    }

    @Override
    public List<Jcx> queryJcxByPid(int pid) {
        return this.jcxMapper.queryJcxByPid(pid);
    }
}
